import { Routes, RouterModule } from '@angular/router';
import { Pages } from './pages.component';

const routes: Routes = [
  {
    path: 'login',
    loadChildren: () => System.import('./login/login.module')
  },
  {
    path: 'pages',
    component: Pages,
    children: [
      { path: '', redirectTo: 'login', pathMatch: 'full' },
      { path: 'dashboard', loadChildren: () => System.import('./dashboard/dashboard.module') },
      { path: 'trip', loadChildren: () => System.import('./trip/trip.module') },
      { path: 'order', loadChildren: () => System.import('./order/order.module') },
      { path: 'driver', loadChildren: () => System.import('./driver/driver.module') },
      { path: 'carrier', loadChildren: () => System.import('./carrier/carrier.module') },
      { path: 'bus', loadChildren: () => System.import('./bus/bus.module') },
      { path: 'user', loadChildren: () => System.import('./user/user.module') },
      { path: 'role', loadChildren: () => System.import('./role/role.module') },
      { path: 'changepwd', loadChildren: () => System.import('./password/password.module') },
      { path: 'payreport', loadChildren: () => System.import('./payreport/payreport.module') },
      { path: 'passengerreport', loadChildren: () => System.import('./passengerreport/passengerreport.module') },
      { path: 'journey', loadChildren: () => System.import('./journey/journey.module') },
      { path: 'tripcarrier', loadChildren: () => System.import('./tripcarrier/tripcarrier.module') },
      { path: 'tripdriver', loadChildren: () => System.import('./tripdriver/tripdriver.module') },
      { path: 'track', loadChildren: () => System.import('./track/track.module') },
      { path: 'position', loadChildren: () => System.import('./position/position.module') },
      { path: 'passenger', loadChildren: () => System.import('./passenger/passenger.module') },
    ]
  }
];

export const routing = RouterModule.forChild(routes);